<?php
	//session_destroy();
	session_start();
	$_SESSION['value']="none";
	class EditReservationManager{
	
		public function validate($str,$param1){
		
			if(is_numeric($param1)&&($str!=null||$str!="")&&(!is_numeric($param1))){
					return true;
				}else{
					return false;
				}
			}


		public function editStudentForm1($str,$param1){
		
			$conn = oci_connect("naiad", "1234", "localhost/XE");
			if((strcmp($str,"snum"))==0){
				$s = oci_parse($conn, "select STUDENTNO, TERM, ORNUM, DATERESERVED, AMOUNT, REMARKS FROM RESERVATION where STUDENTNO like '".$param1."'");
			}				
			
			oci_execute($s);
			$nrows = oci_fetch_all($s, $results);
			if($nrows!=0){
				$i = 0;
				$_SESSION['studentno']=$results['STUDENTNO'][$i];
				$_SESSION['term']=$results['TERM'][$i];
				$_SESSION['ornum']=$results['ORNUM'][$i];
				$_SESSION['datereserved']=$results['DATERESERVED'][$i];
				$_SESSION['amount']=$results['AMOUNT'][$i];
				$_SESSION['remarks']=$results['REMARKS'][$i];
				return 1;	
			}else{
				return 0;
			}
			
		
		}//end of editStudentInfo function
	
		
		public function editStudentForm2($str,$param1){
		
			$conn = oci_connect("naiad", "1234", "localhost/XE");	
			if((strcmp($str,"snum"))==0){
				$s = oci_parse($conn, "select STUDENTNO, AMOUNT, DATERECEIVED, REMARKS FROM KEYDEPOSIT where STUDENTNO like '".$param1."'");
			}			
			
			oci_execute($s);
			$nrows = oci_fetch_all($s, $results);
			$i = 0;
			$_SESSION['studentno']=$results['STUDENTNO'][$i];
			$_SESSION['kamount']=$results['AMOUNT'][$i];
			$_SESSION['datereceived']=$results['DATERECEIVED'][$i];
			$_SESSION['kremarks']=$results['REMARKS'][$i];
		
		return 1;	
		}//end of editStudentParent function
		

	
				
		
		
	}//end of EditStudentManager class

?>